<!-- 
    Copyright (C)  2011  chen wei hua.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 2.0
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU Free Documentation License".
 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../common/jsp/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>资源管理-添加产品</title>
<%@ include file="../../common/jsp/config.jsp"%>
<%@ include file="../../common/jsp/validate.jsp"%>
<script type="text/javascript" src="js/jquery/chinaArea/jquery.fillOptions.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#saveProduct").validate();
		$("#root_category").bind("change", function() {
			var parentId = $(this).val();
			$("#product_name").fillOptions(
					"queryCategoryJOSN.action?categoryId=" + parentId,
					{datatype:"json",text:"name",value:"name",jsonData:"categoryList"});
		});
	});
</script>
</head>

<body>
    <div class="subnav" align="left">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="common/images/title-pk.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt1">基础数据管理</span>
			&nbsp;<img src="common/images/leftico2.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt2">添加产品</span></td>
		  </tr>
		</table>
      </div>
     <s:actionerror cssStyle="color:red"/>
     <div class="main_1">
       <s:form action="saveProduct" name="product" theme="simple">
       <s:if test="product.id>0">
         <s:hidden name="product.id"/>
       </s:if>
       <table width="100%" border="0" cellpadding="10" cellspacing="1" bgcolor="#D3DEEF">
         <tr>
           <td bgcolor="#FAFAFA"><table width="100%" border="0" cellpadding="5" cellspacing="1"  >
             <tr>
               <td width="13%" class="gr-text1"><div align="right"><strong>分类</strong></div></td>
               <td width="87%" align="left">
	          	<s:select id="root_category"
	          	    name="product.category"
	          	    list="categoryList"
	          		listKey="id"
	          		listValue="name"
	          		headerKey="-1"
	          		headerValue="-请选择-" 
	          		cssClass="{selected:true}"/>
                <span class="red-text1">*</span>
               </td>
             </tr>
             <tr>
               <td class="gr-text1"><div align="right"><strong>品名</strong></div></td>
               <td align="left">
	          	<s:select id="product_name"
	          	    name="product.name"
	          	    list="productNameList"
	          		listKey="name"
	          		listValue="name"
	          		headerKey="-1"
	          		headerValue="-请选择-" 
	          		cssClass="{selected:true}"/>
               	 <span class="red-text1">*</span>
               </td>
             </tr>
			 <tr>
               <td class="gr-text1"><div align="right"><strong>规格</strong></div></td>
               <td align="left">
                 <s:textfield name="product.type" size="30" cssClass="{required:true,maxlength:30}" />
                 <span class="red-text1">*</span>
               </td>
			 </tr>
			 <tr>
               <td class="gr-text1"><div align="right"><strong>代码</strong></div></td>
               <td align="left">
                 <s:textfield name="product.productNo" size="15" cssClass="{maxlength:15}" />
               </td>
			 </tr>
			 <tr>
               <td class="gr-text1"><div align="right"><strong>客户产品代码</strong></div></td>
               <td align="left">
                 <s:textfield name="product.customerNo" size="15" cssClass="{maxlength:15}" />
               </td>
			 </tr>
			 <tr>
               <td class="gr-text1"><div align="right"><strong>每箱数量</strong></div></td>
               <td align="left">
                 <s:textfield name="product.pcs" size="7" cssClass="{required:true,number:true}" />
                 <span class="red-text1">*</span>
               </td>
			 </tr>
			  <tr>
               <td class="gr-text1"><div align="right"><strong>每箱重量(Kg)</strong></div></td>
               <td align="left">
                 <s:textfield name="product.weight" size="7" cssClass="{required:true,number:true}" />
                 <span class="red-text1">*</span>
			   </td>
             </tr>
			 <tr>
               <td class="gr-text1"><div align="right"><strong>每箱体积(m3)</strong></div></td>
               <td align="left">
                 <s:textfield name="product.volume" size="7" cssClass="{required:true,number:true}" />
                 <span class="red-text1">*</span>
               </td>
			 </tr>
             <tr>
               <td valign="top"></td>
               <td align="left"><s:submit value="保存" cssClass="input1" />&nbsp;&nbsp;
               <input type="button" value="关闭" class="input1" onclick='javascript:window.location.href="productList.action"' /></td>
             </tr>
           </table></td>
         </tr>
       </table>
       </s:form>
     </div>
     <div class="clear"></div>
</body>
</html>
